package cn.wh.mybatis.session.defaults;

import cn.wh.mybatis.session.Configuration;
import cn.wh.mybatis.session.SqlSession;
import cn.wh.mybatis.session.SqlSessionFactory;

/**
 * @Description 默认的 DefaultSqlSessionFactory
 * @Version 1.0.0
 * @Date 2022/12/26 16:30
 * @Created wh
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private final Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }


    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration);
    }
}
